import {createRouter, createWebHistory} from 'vue-router'

const routes = [
    {
        path: '/',
        name: 'root',
        component: () => import("@/views/login/index.vue"),
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/index.vue')
    },
    {
        path: '/index',
        name: 'index',
        component: () => import('@/views/index.vue'),
        meta: {title: '系统管理'},
        children: [
            {
                path: '/about',
                name: 'about',
                component: () => import('@/About'),
                meta: {title: '关于'}
            }, {
                path: '/sys/menu',
                name: 'menu',
                component: () => import('@/views/system/menu/index.vue'),
                meta: {title: '菜单管理'}
            }, {
                path: '/sys/account',
                name: 'user',
                component: () => import('@/views/system/account/index.vue'),
                meta: {title: '用户管理'}
            }, {
                path: '/sys/dept',
                name: 'dept',
                component: () => import('@/views/system/dept/index.vue'),
                meta: {title: '部门管理'}
            }, {
                path: '/sys/role',
                name: 'role',
                component: () => import('@/views/system/role/index.vue'),
                meta: {title: '角色管理'}
            }, {
                path: '/sys/post',
                name: 'post',
                component: () => import('@/views/system/post/index.vue'),
                meta: {title: '岗位管理'}
            }, {
                path: '/sys/profile',
                name: 'profile',
                component: () => import('@/views/system/profile/index.vue'),
                meta: {title: '我的信息'}
            }
        ]
    },
    {
        path: '/config',
        name: 'config',
        component: () => import('@/views/system/config')

    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_USER),
    routes
})

export default router
